package experimentUI;

import javax.swing.*;
import java.awt.*;

/*
    用来遮盖原件以表示原件是否接入电路的按钮
 */
public class whiteButton extends JButton {
    public whiteButton(){
        setBackground(Color.white);
        setBorder(null);
    }
    public whiteButton(String name){
        setText(name);
        setBackground(Color.white);
        setBorder(null);
    }
    public JLabel addBackgroundImage(Container container,String imageName,int x,int y,int width,int height){
        ImageIcon icon = new ImageIcon("src/" + imageName);
        JLabel jl = new JLabel();
        jl.setIcon(icon);
        container.add(jl,Integer.valueOf(Integer.MIN_VALUE+1));
        container.add(this,Integer.valueOf(Integer.MAX_VALUE));
        jl.setBounds(x,y,width,height);
        this.setBounds(x,y,width, height+50);
        this.setContentAreaFilled(false);
        return jl;
    }
}
